

using System;
using Microsoft.EntityFrameworkCore;

namespace Blog.Util
{
    public abstract class SqlHelper
    {
        private static string ConnStr=WebConfig.GetConnectionString("DefaultConnection");

        public static Action<DbContextOptionsBuilder> GetDbContextOptionsBuilder(string db)
        {
            switch(db)
            {
                case "sqlite":
                return o=>o.UseSqlite(ConnStr);
                case "sqlserver":
                return o=>o.UseSqlServer(ConnStr);
                // case "mysql":
                // return o=>o.UseMySQL(ConnStr);
            }  
            return null;
        }    

    }
}